<?
	$this->addScript($this->Html->css('datepicker'));
	$this->addScript($this->Html->script('date'));
	$this->addScript($this->Html->script('datepicker'));
	
	$this->addScript($this->Javascript->codeBlock('
		$(document).ready(function() {
			
			$(".date-picker").val((new Date()).asString());

			$(".date-picker").datePicker({
						clickInput	: true,
						startDate	: "1970/01/01",
						endDate		: (new Date()).asString()
					}
			);

		$("#pack").change(function(){
			if($(this).val() == 0){
				$("#horas").fadeIn();
				$("#alumnos").fadeIn();
			}
			else{
				$("#horas").fadeOut();
				$("#AyudantiaNumeroHoras").val("0");
				$("#alumnos").fadeOut();
				$("#AyudantiaNumeroAlumnos").val("0");
			}
		});

	});
'));
?>
<div class="usuarios form">
<?php echo $this->Form->create('Ayudantia');?>
	<fieldset>
 		<legend><?php __('Usuario || Solicitar ayudantia'); ?></legend>
                <div class="actions_links">
                        <ul>                                                        
                        </ul>
                </div>
	

		<div class="campo"><?=$this->Form->input('asignatura_id');?></div>
		<div class="campo"><?=$this->Form->input('pack_id', array('empty' => array('0' =>'Sin pack'), 'id' => 'pack')); ?></div>
		<div class="campo"><?=$this->Form->input('materia'); ?></div>
		<div class="campo"><?=$this->Form->input('modalidad'); ?></div>
		<div class="campo" id="horas"><?=$this->Form->input('numero_horas', array('')); ?></div>
		<div class="campo" id="alumnos"><?=$this->Form->input('numero_alumnos'); ?></div>
		<div class="campo"><?=$this->Form->input('fecha', array('type'=>'text','div'=>false,'class' => 'date-picker'))?></div>
		<div class="campo"><?=$this->Form->input('direccion'); ?></div>
		<div class="campo"><?=$this->Form->input('observacion'); ?></div>
		<div class="campo"><?=$this->Form->input('precio'); ?></div>
		<?=$this->Form->input('estado', array('type' => 'hidden', 'value' => 'pendiente'));?>
		<div class="campo"><?=$this->Form->end(__('Solicitar', true)); ?></div>
	</fieldset>

</div>
